package cn.iocoder.yudao.module.vos.dal.mysql.activitytask;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.vos.dal.dataobject.activitytask.ActivityTaskDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.vos.controller.admin.activitytask.vo.*;

/**
 * 活动任务详情 Mapper
 *
 * @author shijun
 */
@Mapper
public interface ActivityTaskMapper extends BaseMapperX<ActivityTaskDO> {

    default PageResult<ActivityTaskDO> selectPage(ActivityTaskPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ActivityTaskDO>()
                .eqIfPresent(ActivityTaskDO::getRequestId, reqVO.getRequestId())
                .eqIfPresent(ActivityTaskDO::getCode, reqVO.getCode())
                .eqIfPresent(ActivityTaskDO::getMessage, reqVO.getMessage())
                .eqIfPresent(ActivityTaskDO::getBatchId, reqVO.getBatchId())
                .eqIfPresent(ActivityTaskDO::getImportNum, reqVO.getImportNum())
                .betweenIfPresent(ActivityTaskDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(ActivityTaskDO::getMarketingTool, reqVO.getMarketingTool())
                .orderByDesc(ActivityTaskDO::getId));
    }

}